import React, {Component} from 'react';
import { View, Text,StyleSheet,Image,Dimensions,ScrollView } from 'react-native';
import config from '../config';

export default class Ctabs extends Component {
    //构造函数
    constructor(props) {
        super(props);
        // this.state = {
        //     selectedTab: props.selectedTab ? props.selectedTab : 'Home',//选择TabBar.Item
        // };
    }

    componentDidMount() {
        
    }

    //组件卸载
    componentWillUnmount() {

    }

    componentWillReceiveProps(nextProps) {
    }

    renderlist()
    {
        let ts=[];
        if(this.props.data)
        {
            this.props.data.forEach(c=>{
                ts.push(
                    //onPress={this.props.onTabClick}
                    <View>
                        <Text>{c.title}</Text>
                    </View>
                );
            });
        }
       
        return ts;
    }

    render() {
        return (
            <ScrollView style={{flexDirection:"row"}} horizontal={true}>
                {this.renderlist()}
            </ScrollView>
        );
    }
}
